package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.system.HeartbeatMsg;
import com.ruoyi.system.mapper.HeartbeatMsgMapper;
import com.ruoyi.system.service.IHeartbeatMsgService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 终端心跳上传报文记录Service业务层处理
 *
 * @author zjw
 * @date 2023-12-21
 */
@Service
public class HeartbeatMsgServiceImpl implements IHeartbeatMsgService {
    @Resource
    private HeartbeatMsgMapper heartbeatMsgMapper;

    /**
     * 查询终端心跳上传报文记录
     *
     * @param msgid 终端心跳上传报文记录主键
     * @return 终端心跳上传报文记录
     */
    @Override
    public HeartbeatMsg selectHeartbeatMsgByMsgid(Long msgId) {
        return heartbeatMsgMapper.selectHeartbeatMsgByMsgid(msgId);
    }

    /**
     * 查询终端心跳上传报文记录列表
     *
     * @param heartbeatMsg 终端心跳上传报文记录
     * @return 终端心跳上传报文记录
     */
    @Override
    public List<HeartbeatMsg> selectHeartbeatMsgList(HeartbeatMsg heartbeatMsg) {
        return heartbeatMsgMapper.selectHeartbeatMsgList(heartbeatMsg);
    }

    /**
     * 新增终端心跳上传报文记录
     *
     * @param heartbeatMsg 终端心跳上传报文记录
     * @return 结果
     */
    @Override
    public int insertHeartbeatMsg(HeartbeatMsg heartbeatMsg) {
        return heartbeatMsgMapper.insertHeartbeatMsg(heartbeatMsg);
    }

    /**
     * 修改终端心跳上传报文记录
     *
     * @param heartbeatMsg 终端心跳上传报文记录
     * @return 结果
     */
    @Override
    public int updateHeartbeatMsg(HeartbeatMsg heartbeatMsg) {
        return heartbeatMsgMapper.updateHeartbeatMsg(heartbeatMsg);
    }

    /**
     * 批量删除终端心跳上传报文记录
     *
     * @param msgids 需要删除的终端心跳上传报文记录主键
     * @return 结果
     */
    @Override
    public int deleteHeartbeatMsgByMsgids(Long[] msgids) {
        return heartbeatMsgMapper.deleteHeartbeatMsgByMsgids(msgids);
    }

    /**
     * 删除终端心跳上传报文记录信息
     *
     * @param msgid 终端心跳上传报文记录主键
     * @return 结果
     */
    @Override
    public int deleteHeartbeatMsgByMsgid(Long msgid) {
        return heartbeatMsgMapper.deleteHeartbeatMsgByMsgid(msgid);
    }
}
